package com.accedo.achievements.dataaccess.dao;

import java.util.List;
import java.util.Map;

import com.accedo.achievements.dataaccess.model.Campaign;

/**
 * A DAO interface with campaign model database operations.
 * @author Bo Liang
 */
public interface CampaignDao {
	
	/**
	 * Get available campaign object List.
	 * <p>only the campaign's end date is greater than current system date,
	 * this campaign is able to be added to the campaign list and return.
	 * @return List with campaign object
	 */
	public List<Campaign> getAvailableCampList();
	
	/**
	 * Get the user's all active campaign objects in Map format by using user id.
	 * <p>the active campaign for user means that this user at least unlocked one achievement related this campaign.
	 * this function return two types of Map key-value pair: if one campaign's achievements have already totally unlocked by user, it puts <camp_id, "finished">,
	 * if one campaign's achievements have not unlocked completed but at least one, it puts <camp_id, "playing"> into Map.
	 * @param user_id	user id
	 * @return			List of campaign id
	 */
	public Map<Integer, String> getActiveCampIdMapByUserId(int user_id);
	
	/**
	 * Get campaign id List by using achievement id.
	 * <p> one achievement may related several campaigns,
	 * it means one campaign includes several achievements,
	 * if you want to join the campaign, you have to unlock all of the relevant achievements 
	 * and several campaigns may have one same achievement,
	 * this function returns these campaigns id which have this same achievement,
	 * return these badge's id in a List.
	 * 
	 * @param achi_id	achievement id
	 * @return			List of campaign's id
	 */
	public List<Integer> getCampIdListByAchiId(int achi_id);
}
